Termination w.r.t. Q of the following Term Rewriting System could be proven:

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

Q is empty.


QTRS
  ↳ Overlay + Local Confluence

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

Q is empty.

The TRS is overlay and locally confluent. By [19] we can switch to innermost.

↳ QTRS
  ↳ Overlay + Local Confluence
QTRS
      ↳ DependencyPairsProof

Q restricted rewrite system:
The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))


Using Dependency Pairs [1,15] we result in the following initial DP problem:
Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, false), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, false), f), xs) → AP(cons, ap(f, ap(last, xs)))
AP(ap(ap(if, false), f), xs) → AP(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
AP(ap(ap(if, false), f), xs) → AP(map, f)
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(ap(if, false), f), xs) → AP(dropLast, xs)
AP(ap(ap(if, false), f), xs) → AP(last, xs)
AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))
AP(ap(ap(if, false), f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(if, ap(isEmpty, xs)), f)
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
AP(ap(map, f), xs) → AP(if, ap(isEmpty, xs))
AP(ap(map, f), xs) → AP(isEmpty, xs)

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
QDP
          ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, false), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, false), f), xs) → AP(cons, ap(f, ap(last, xs)))
AP(ap(ap(if, false), f), xs) → AP(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
AP(ap(ap(if, false), f), xs) → AP(map, f)
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
AP(ap(ap(if, false), f), xs) → AP(dropLast, xs)
AP(ap(ap(if, false), f), xs) → AP(last, xs)
AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))
AP(ap(ap(if, false), f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(if, ap(isEmpty, xs)), f)
AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
AP(ap(map, f), xs) → AP(if, ap(isEmpty, xs))
AP(ap(map, f), xs) → AP(isEmpty, xs)

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 3 SCCs with 9 less nodes.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
QDP
                ↳ UsableRulesProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ ATransformationProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(dropLast, ap(ap(cons, y), ys))

R is empty.
The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
QDP
                        ↳ QReductionProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

dropLast1(cons(x, cons(y, ys))) → dropLast1(cons(y, ys))

R is empty.
The set Q consists of the following terms:

map(x0, x1)
if(true, x0, x1)
if(false, x0, x1)
isEmpty(nil)
isEmpty(cons(x0, x1))
last(cons(x0, nil))
last(cons(x0, cons(x1, x2)))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

map(x0, x1)
if(true, x0, x1)
if(false, x0, x1)
isEmpty(nil)
isEmpty(cons(x0, x1))
last(cons(x0, nil))
last(cons(x0, cons(x1, x2)))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
                      ↳ QDP
                        ↳ QReductionProof
QDP
                            ↳ QDPSizeChangeProof
              ↳ QDP
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

dropLast1(cons(x, cons(y, ys))) → dropLast1(cons(y, ys))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
QDP
                ↳ UsableRulesProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ ATransformationProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

AP(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → AP(last, ap(ap(cons, y), ys))

R is empty.
The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
QDP
                        ↳ QReductionProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

last1(cons(x, cons(y, ys))) → last1(cons(y, ys))

R is empty.
The set Q consists of the following terms:

map(x0, x1)
if(true, x0, x1)
if(false, x0, x1)
isEmpty(nil)
isEmpty(cons(x0, x1))
last(cons(x0, nil))
last(cons(x0, cons(x1, x2)))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

map(x0, x1)
if(true, x0, x1)
if(false, x0, x1)
isEmpty(nil)
isEmpty(cons(x0, x1))
last(cons(x0, nil))
last(cons(x0, cons(x1, x2)))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ ATransformationProof
                      ↳ QDP
                        ↳ QReductionProof
QDP
                            ↳ QDPSizeChangeProof
              ↳ QDP

Q DP problem:
The TRS P consists of the following rules:

last1(cons(x, cons(y, ys))) → last1(cons(y, ys))

R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
QDP
                ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, false), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, false), f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)

The TRS R consists of the following rules:

ap(ap(map, f), xs) → ap(ap(ap(if, ap(isEmpty, xs)), f), xs)
ap(ap(ap(if, true), f), xs) → nil
ap(ap(ap(if, false), f), xs) → ap(ap(cons, ap(f, ap(last, xs))), ap(ap(map, f), ap(dropLast, xs)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))
ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
QDP
                    ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, false), f), xs) → AP(f, ap(last, xs))
AP(ap(ap(if, false), f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)

The TRS R consists of the following rules:

ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


AP(ap(ap(if, false), f), xs) → AP(f, ap(last, xs))
The remaining pairs can at least be oriented weakly.

AP(ap(ap(if, false), f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)
Used ordering: Polynomial interpretation [25]:

POL(AP(x1, x2)) = x1   
POL(ap(x1, x2)) = 1 + x2   
POL(cons) = 0   
POL(dropLast) = 0   
POL(false) = 1   
POL(if) = 0   
POL(isEmpty) = 0   
POL(last) = 0   
POL(map) = 0   
POL(nil) = 1   
POL(true) = 1   

The following usable rules [17] were oriented: none



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
QDP
                        ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, false), f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)

The TRS R consists of the following rules:

ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false
ap(last, ap(ap(cons, x), nil)) → x
ap(last, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(last, ap(ap(cons, y), ys))

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
QDP
                            ↳ ATransformationProof

Q DP problem:
The TRS P consists of the following rules:

AP(ap(ap(if, false), f), xs) → AP(ap(map, f), ap(dropLast, xs))
AP(ap(map, f), xs) → AP(ap(ap(if, ap(isEmpty, xs)), f), xs)

The TRS R consists of the following rules:

ap(dropLast, nil) → nil
ap(dropLast, ap(ap(cons, x), nil)) → nil
ap(dropLast, ap(ap(cons, x), ap(ap(cons, y), ys))) → ap(ap(cons, x), ap(dropLast, ap(ap(cons, y), ys)))
ap(isEmpty, nil) → true
ap(isEmpty, ap(ap(cons, x), xs)) → false

The set Q consists of the following terms:

ap(ap(map, x0), x1)
ap(ap(ap(if, true), x0), x1)
ap(ap(ap(if, false), x0), x1)
ap(isEmpty, nil)
ap(isEmpty, ap(ap(cons, x0), x1))
ap(last, ap(ap(cons, x0), nil))
ap(last, ap(ap(cons, x0), ap(ap(cons, x1), x2)))
ap(dropLast, nil)
ap(dropLast, ap(ap(cons, x0), nil))
ap(dropLast, ap(ap(cons, x0), ap(ap(cons, x1), x2)))

We have to consider all minimal (P,Q,R)-chains.
We have applied the A-Transformation [17] to get from an applicative problem to a standard problem.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
QDP
                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

if1(false, f, xs) → map1(f, dropLast(xs))
map1(f, xs) → if1(isEmpty(xs), f, xs)

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, nil)) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(nil) → true
isEmpty(cons(x, xs)) → false

The set Q consists of the following terms:

map(x0, x1)
if(true, x0, x1)
if(false, x0, x1)
isEmpty(nil)
isEmpty(cons(x0, x1))
last(cons(x0, nil))
last(cons(x0, cons(x1, x2)))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

map(x0, x1)
if(true, x0, x1)
if(false, x0, x1)
last(cons(x0, nil))
last(cons(x0, cons(x1, x2)))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
QDP
                                    ↳ Narrowing

Q DP problem:
The TRS P consists of the following rules:

if1(false, f, xs) → map1(f, dropLast(xs))
map1(f, xs) → if1(isEmpty(xs), f, xs)

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, nil)) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(nil) → true
isEmpty(cons(x, xs)) → false

The set Q consists of the following terms:

isEmpty(nil)
isEmpty(cons(x0, x1))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
By narrowing [15] the rule map1(f, xs) → if1(isEmpty(xs), f, xs) at position [0] we obtained the following new rules:

map1(y0, nil) → if1(true, y0, nil)
map1(y0, cons(x0, x1)) → if1(false, y0, cons(x0, x1))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
QDP
                                        ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

map1(y0, nil) → if1(true, y0, nil)
map1(y0, cons(x0, x1)) → if1(false, y0, cons(x0, x1))
if1(false, f, xs) → map1(f, dropLast(xs))

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, nil)) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(nil) → true
isEmpty(cons(x, xs)) → false

The set Q consists of the following terms:

isEmpty(nil)
isEmpty(cons(x0, x1))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 1 SCC with 1 less node.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
QDP
                                            ↳ UsableRulesProof

Q DP problem:
The TRS P consists of the following rules:

if1(false, f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(false, y0, cons(x0, x1))

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, nil)) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
isEmpty(nil) → true
isEmpty(cons(x, xs)) → false

The set Q consists of the following terms:

isEmpty(nil)
isEmpty(cons(x0, x1))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
As all Q-normal forms are R-normal forms we are in the innermost case. Hence, by the usable rules processor [15] we can delete all non-usable rules [17] from R.

↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
QDP
                                                ↳ QReductionProof

Q DP problem:
The TRS P consists of the following rules:

if1(false, f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(false, y0, cons(x0, x1))

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, nil)) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

isEmpty(nil)
isEmpty(cons(x0, x1))
dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We deleted the following terms from Q as each root-symbol of these terms does neither occur in P nor in R.

isEmpty(nil)
isEmpty(cons(x0, x1))



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
                                              ↳ QDP
                                                ↳ QReductionProof
QDP
                                                    ↳ RuleRemovalProof

Q DP problem:
The TRS P consists of the following rules:

map1(y0, cons(x0, x1)) → if1(false, y0, cons(x0, x1))
if1(false, f, xs) → map1(f, dropLast(xs))

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, nil)) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
By using the rule removal processor [15] with the following polynomial ordering [25], at least one Dependency Pair or term rewrite system rule of this QDP problem can be strictly oriented.

Strictly oriented rules of the TRS R:

dropLast(cons(x, nil)) → nil

Used ordering: POLO with Polynomial interpretation [25]:

POL(cons(x1, x2)) = 2·x1 + 2·x2   
POL(dropLast(x1)) = x1   
POL(false) = 0   
POL(if1(x1, x2, x3)) = 1 + 2·x1 + x2 + x3   
POL(map1(x1, x2)) = 1 + x1 + x2   
POL(nil) = 2   



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
                                              ↳ QDP
                                                ↳ QReductionProof
                                                  ↳ QDP
                                                    ↳ RuleRemovalProof
QDP
                                                        ↳ QDPOrderProof

Q DP problem:
The TRS P consists of the following rules:

if1(false, f, xs) → map1(f, dropLast(xs))
map1(y0, cons(x0, x1)) → if1(false, y0, cons(x0, x1))

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
We use the reduction pair processor [15].


The following pairs can be oriented strictly and are deleted.


map1(y0, cons(x0, x1)) → if1(false, y0, cons(x0, x1))
The remaining pairs can at least be oriented weakly.

if1(false, f, xs) → map1(f, dropLast(xs))
Used ordering: Matrix interpretation [3]:
Non-tuple symbols:
M( cons(x1, x2) ) =
/1\
\0/
+
/00\
\00/
·x1+
/10\
\10/
·x2

M( false ) =
/0\
\0/

M( nil ) =
/1\
\1/

M( dropLast(x1) ) =
/0\
\0/
+
/01\
\10/
·x1

Tuple symbols:
M( map1(x1, x2) ) = 0+
[1,1]
·x1+
[1,0]
·x2

M( if1(x1, ..., x3) ) = 0+
[0,0]
·x1+
[1,1]
·x2+
[0,1]
·x3


Matrix type:
We used a basic matrix type which is not further parametrizeable.


As matrix orders are CE-compatible, we used usable rules w.r.t. argument filtering in the order.
The following usable rules [17] were oriented:

dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))
dropLast(nil) → nil



↳ QTRS
  ↳ Overlay + Local Confluence
    ↳ QTRS
      ↳ DependencyPairsProof
        ↳ QDP
          ↳ DependencyGraphProof
            ↳ AND
              ↳ QDP
              ↳ QDP
              ↳ QDP
                ↳ UsableRulesProof
                  ↳ QDP
                    ↳ QDPOrderProof
                      ↳ QDP
                        ↳ UsableRulesProof
                          ↳ QDP
                            ↳ ATransformationProof
                              ↳ QDP
                                ↳ QReductionProof
                                  ↳ QDP
                                    ↳ Narrowing
                                      ↳ QDP
                                        ↳ DependencyGraphProof
                                          ↳ QDP
                                            ↳ UsableRulesProof
                                              ↳ QDP
                                                ↳ QReductionProof
                                                  ↳ QDP
                                                    ↳ RuleRemovalProof
                                                      ↳ QDP
                                                        ↳ QDPOrderProof
QDP
                                                            ↳ DependencyGraphProof

Q DP problem:
The TRS P consists of the following rules:

if1(false, f, xs) → map1(f, dropLast(xs))

The TRS R consists of the following rules:

dropLast(nil) → nil
dropLast(cons(x, cons(y, ys))) → cons(x, dropLast(cons(y, ys)))

The set Q consists of the following terms:

dropLast(nil)
dropLast(cons(x0, nil))
dropLast(cons(x0, cons(x1, x2)))

We have to consider all minimal (P,Q,R)-chains.
The approximation of the Dependency Graph [15,17,22] contains 0 SCCs with 1 less node.